import request from "@/utils/request";

// 查询优惠券信息
export function listCoupon(query) {
  return request({
    url: "/marketing/couponInfo/front/list",
    method: "get",
    params: query,
  });
}

// 查询个人优惠领取记录
export function listUserCouponHistory(query) {
  return request({
    url: "/marketing/couponHistory/list/currentUser",
    method: "get",
    params: query,
  });
}

// 领取优惠券
export function addCoupon(data) {
  return request({
    url: "/marketing/couponHistory",
    method: "post",
    data: data,
  });
}
